From: Kunal Mehta Date: Wed, 1 Feb 2017 20:50:06 +0000 (-0800) Subject: API: Guard more ug_expiry queries with $wgDisableUserGroupExpiry checks X-Git-Tag: 1.31.0-rc.0~4167^2 X-Git-Url: http://git.cyclocoop.org//%22http:/%22.attribut_html%28%24lesurls%5B%24numero%5D%29.%22/%22?a=commitdiff_plain;ds=sidebyside;h=8c394a74272e1db2d3a1107580c573094c045ce8;p=lhc%2Fweb%2Fwiklou.git API: Guard more ug_expiry queries with $wgDisableUserGroupExpiry checks Change-Id: Ibaafd9dc49b8aebcf0a00a507712baeec8c11e42 --- diff --git a/includes/api/ApiQueryAllUsers.php b/includes/api/ApiQueryAllUsers.php index 1c3b171fd4..21db3ca20e 100644 --- a/includes/api/ApiQueryAllUsers.php +++ b/includes/api/ApiQueryAllUsers.php @@ -147,7 +147,9 @@ class ApiQueryAllUsers extends ApiQueryBase { $this->addJoinConds( [ 'ug1' => [ 'LEFT OUTER JOIN', array_merge( [ 'ug1.ug_user=user_id', - 'ug1.ug_expiry IS NULL OR ug1.ug_expiry >= ' . $db->addQuotes( $db->timestamp() ) + $this->getConfig()->get( 'DisableUserGroupExpiry' ) ? + '1' : + 'ug1.ug_expiry IS NULL OR ug1.ug_expiry >= ' . $db->addQuotes( $db->timestamp() ) ], $exclude ) ] ] ); $this->addWhere( 'ug1.ug_user IS NULL' ); @@ -163,7 +165,9 @@ class ApiQueryAllUsers extends ApiQueryBase { $this->addFields( [ 'groups' => $db->buildGroupConcatField( '|', 'user_groups', 'ug_group', [ 'ug_user=user_id', - 'ug_expiry IS NULL OR ug_expiry >= ' . $db->addQuotes( $db->timestamp() ) + $this->getConfig()->get( 'DisableUserGroupExpiry' ) ? + '1' : + 'ug1.ug_expiry IS NULL OR ug1.ug_expiry >= ' . $db->addQuotes( $db->timestamp() ) ] ) ] ); }